<div class="team-management">
    <div class="m-subheader">
        <div class="row align-items-center">
            <div class="mr-auto col-auto">
                <h3 class="m-subheader__title m-subheader__title--separator">
                    <span>班组工时管理</span>
                </h3>
            </div>
        </div>
    </div>
    <div class="m-content">
        <div class="m-portlet m-portlet--mobile">
            <div class="m-portlet__body">
                <div class="p-formgroup-inline">
                    <!-- <span class="p-field">
                        <span class="input-lable" style="margin-right: 20px;margin-left: 150px;">型号：</span>
                        <input style="line-height: 24px!important;width: 150px;" id="model" type="text" size="30" pInputText
                            [(ngModel)]="model">
                    </span> -->
                    <span class="p-field ml">
                        <span class="input-lable">型号：</span>
                        <p-dropdown filter="true" name="model" #lotNoSelect="ngModel" [options]="modelOption"
                            [(ngModel)]="model" dataKey="value" [optionLabel]="'label'" placeholder="请选择" (onChange)="onChange($event)">
                        </p-dropdown>
                    </span>
                    <span class="p-field ml">
                        <span class="input-lable">发次：</span>
                        <p-dropdown filter="true" name="lotNoList" #lotNoSelect="ngModel" [options]="LotNoList"
                            [(ngModel)]="lotNo" dataKey="value" [optionLabel]="'label'"
                            (onChange)="getOrganizationUnit()" placeholder="请选择">
                        </p-dropdown>
                    </span>
                    <span class="p-field ml">
                        <span class="input-lable">班组：</span>
                        <p-dropdown filter="true" name="sstroeName" [options]="organizationUnitList" placeholder="请选择班组"
                            [(ngModel)]="organiza" emptyFilterMessage="暂无数据">
                            <ng-template let-item pTemplate="selectedItem">
                                <span *ngIf="organiza != 'undefind' "
                                    style="vertical-align:middle; margin-left: .5em;width: 147px;">{{item.label}}</span>
                                <span *ngIf="organiza == 'undefind' "
                                    style="vertical-align:middle; margin-left: .5em;width: 147px;"> </span>
                            </ng-template>
                            <ng-template let-model pTemplate="item">
                                <div class="ui-helper-clearfix" style="position: relative;height: 25px;">
                                    <div style="font-size:14px;float:right;margin-top:4px;width: 147px;">{{model.label}}
                                    </div>
                                </div>
                            </ng-template>
                        </p-dropdown>
                    </span>
                    <span class="p-field ml">
                        <span class="input-lable">日期：</span>
                        <p-calendar [(ngModel)]="rangeDates" selectionMode="range" [readonlyInput]="true"></p-calendar>
                    </span>
                    <!-- <span class="p-field">
                        <span class="ml input-lable" style="margin-right: 20px;">变更类型：</span>
                        <p-dropdown name="changeType" [options]="changeTypeOptions" [(ngModel)]="changeType" placeholder="请选择变更类型"
                            emptyFilterMessage="暂无数据">
                            <ng-template let-item pTemplate="selectedItem">
                                <span *ngIf="changeType != undefind "
                                    style="vertical-align:middle; margin-left: .5em;width: 147px;">{{item.label}}</span>
                                <span *ngIf="changeType == undefind "
                                    style="vertical-align:middle; margin-left: .5em;width: 147px;"> </span>
                            </ng-template>
                            <ng-template let-model pTemplate="item">
                                <div class="ui-helper-clearfix" style="position: relative;height: 25px;">
                                    <div style="font-size:14px;float:right;margin-top:4px;width: 147px;">{{model.label}}
                                    </div>
                                </div>
                            </ng-template>
                        </p-dropdown>
                    </span> -->
                    <p-button label="查询" (onClick)="getTableList($event)" class="ml"></p-button>
                    <p-button label="重置" (onClick)="reset()" class="ml"></p-button>
                    <p-button *ngIf="'Pages.ShiftManagement.Export' | permission" label="导出" (onClick)="outExcel()" class="ml"></p-button>
                </div>
                <div style="height: 80%; width: 100%;display: flex; background-color: #DDDDDD;margin-top: 10px;">
                    <div style="width: 99%; height: 98%; background-color: #fff;margin: 10px;margin: 5px;">
                        <p-chart type="bar" [data]="barData1" height="325"></p-chart>
                    </div>
                </div>
                <div class="row align-items-center" style="margin-top: 25px;">
                    <div class="primeng-datatable-container">
                        <p-table #dataTable [value]="primengTableHelper.records" (onLazyLoad)="getTableList($event)"
                            rows="{{primengTableHelper.defaultRecordsCountPerPage}}" [paginator]="false" [lazy]="true"
                            [scrollable]="true" ScrollWidth="100%" [responsive]="primengTableHelper.isResponsive"
                            [resizableColumns]="primengTableHelper.resizableColumns">
                            <ng-template pTemplate="header">
                                <tr>
                                    <th style="width: 80px;">序号</th>
                                    <th style="width: 150px">装配班组</th>
                                    <th style="width: 150px">人员</th>
                                    <th style="width: 150px">型号</th>
                                    <th style="width: 150px">发次</th>
                                    <th style="width: 150px">报工任务数</th>
                                    <th style="width: 150px">标准总工时</th>
                                    <th style="width: 150px">提报总工时</th>
                                </tr>
                            </ng-template>
                            <ng-template pTemplate="body" let-record="$implicit" let-rowIndex="rowIndex">
                                <tr>
                                    <td style="width: 80px;">{{rowIndex+1}}</td>
                                    <td style="width: 150px">{{record.organizationUnitDesc}}</td>
                                    <td style="width: 150px">{{record.userName}}</td>
                                    <td style="width: 150px">{{record.model}}</td>
                                    <td style="width: 150px">{{record.lotNo}}</td>
                                    <td style="width: 150px">{{record.taskConut}}</td>
                                    <td style="width: 150px">{{record.sumWorkingHour}}</td>
                                    <td style="width: 150px">{{record.sumReportHour}}</td>
                                </tr>

                            </ng-template>
                        </p-table>
                        <!-- <div class="primeng-paging-container">
                            <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage" #paginator
                                (onPageChange)="getTableList($event)"
                                [totalRecords]="primengTableHelper.totalRecordsCount"
                                [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">
                            </p-paginator>
                            <span class="total-records-count">
                                {{'TotalRecordsCount' | localize:primengTableHelper.totalRecordsCount}}
                            </span>
                        </div> -->
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>